package com.lry;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;

public class Start {

    public static void main(String[] args) throws IOException {
        RedPacket redPacket = new RedPacket();
        redPacket.sendPacket(10000,100);

        List<Thread> threads = new ArrayList<>();


        for(int i=0;i<1000;i++){
            Thread thread = new Thread(()->{
                redPacket.robPacket();
            });
            threads.add(thread);
        }
        threads.stream().parallel().forEach(Thread::start);

        System.in.read();
    }

}
